<template>
	<view class="">
		<u-sticky bgColor="#a3d8f5">
			<view class="mainpadding" :style="{paddingTop:menutop+'rpx'}">
				<view class="flexleft">
					<image src="@/static/image/system/hsz.png" class="hszclass" mode=""></image>
					<view class="xiaobai fonweight" style="font-size: 35rpx;">红十字基金会“孤寡老人大病救助基金”</view>
				</view>
				<view class="margin_top flexbetween">
					<u-icon name="arrow-left" color="#fff" size="24" @click="backpage()"></u-icon>
					<view class="xiaobai fonweight sanshier" style="font-size: 32rpx;">我的救助申请</view>
					<image src="@/static/image/system/list.png" mode="" class="topliclass" @click="toplistfn"></image>
				</view>
			</view>
		</u-sticky>
		<view class="mainpadding2">
			<view class="flexcolumn" v-if="list.total==0">
				<view class="placeholderimage"></view>
				<view class="xiaohui textcenter mainpadding_top" style="margin-top: 0rpx;color: #666666;font-size: 40rpx;line-height: 80rpx;">
					<text>您还没有提交申请</text>
					<br />
					<text>如需申请，请点击</text>
					<br />
					<text class="xiaohuang" style="color: #cc0000;margin-top: 30rpx;display: inline-block;" @click="jiuzhusq()">立即申请</text></view>
			</view>
			<view class="mainpadding_top ffffff radius" v-for="item in list.data" :key="item.id" @click="jumpdetail('/pages/mine/jiuzhusqxq?id=',item.id)">
				<view class="flexbetween">
					<view class="xiaohei titletext fonweight">{{item.name}}</view>
					<!-- 状态:1=待审核,2=审核通过,3=审核拒绝,4=补充材料 -->
					<view class="xiaohuang ershiba" v-show="item.status==1">待审核</view>
					<view class="xiaolv ershiba" v-show="item.status==2">审核通过</view>
					<view class="xiaohong ershiba" v-show="item.status==3">审核拒绝</view>
					<view class="xiaohui ershiba" v-show="item.status==4">补充材料</view>
				</view>
				<view class="xiaohei margin_top ershiba">{{item.jzyy}}：<text class="xiaohong">{{item.bqzk}}</text></view>
				<view class="xiaohei margin_top ershiba">领款人：{{item.lkname}}</view>
				<view class="margin_top xiaohui ershiba">{{item.createtime_text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				// #ifdef H5
				menutop: 80,
				// #endif
				// #ifdef MP-WEIXIN
				menutop: 0,
				// #endif	
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			// #ifdef MP-WEIXIN
			this.menutop = uni.getMenuButtonBoundingClientRect().top * 2
			// #endif
			
		},
		onShow() {
			this.init()
		},
		methods: {
			jiuzhusq(){
				uni.switchTab({
					url:"/pages/jiuzhu/jiuzhu"
				})
			},
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/user/jzapplyIndex', 'GET', {
					page: page || 1,
					limit: 12,
				}).then(res => {
					uni.stopPullDownRefresh()
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>

</style>
